<?php
/**
 * Created by PhpStorm.
 * User: 小蛮哼哼哼
 * Email: 243194993@qq.com
 * Date: 2022/1/17
 * Time: 15:48
 * motto: 现在的努力是为了小时候吹过的牛逼！
 */

declare(strict_types=1);

namespace app\api\model\mysql;

use app\common\model\TimeModel;

class MallBanner extends TimeModel
{
    protected $deleteTime = "delete_time";
    /**
     * 查询所有正常的banner
     * @param $type 1首页 2商城
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function getBannerList($type): array
    {
        return $this->field('id,logo')->where('status', 1)
            ->where('type',$type)
            ->select()
            ->toArray();
    }
}